<!-- 
	개인정보보기
 -->

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="model.*" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0, user-scalable=no" />
	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
	<link rel="Stylesheet" href="css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="css/questudy.css" />
	
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
	<script src="js/questudy.js" ></script>
	<script src="js/mypage/mypage.js"></script>
	<script src="js/joinus/joinus.js"></script>

<title>User Info</title>
</head>
<%
	ArrayList<Language> langList = (ArrayList<Language>)request.getAttribute("langList");
	User user = (User)request.getAttribute("user");
	//User user = new User();
	//user.setMemid("test"); user.setName("양지우"); user.setEmail("abc@naver.com");
	//user.setpNum("010-0000-0000"); user.setUniv("아주대"); user.setGrade("3.5");
	//ArrayList<Language> langList = new ArrayList<Language>();
%>
<jsp:include page="nav/nav_main.jsp"></jsp:include>
	<div class="container firstDiv">
		<form method="post" name="modifyForm" action="ModifyAction.Member">
			<div class="container">
				<div class="col-md-6 col-md-offset-3">
					<div class="input-group">
						<span class="input-group-addon">*ID</span>
						<input type="text" id="userId" disabled name="memid" class="form-control" placeholder="ID" onchange="changeIdDupState()" value=<%= user.getMemid() %>>
					</div>
					<div class="input-group">
					<span class="input-group-addon">*비밀번호</span>
					<input type="password" id="password" name="passwd" class="form-control" placeholder="Password">
					</div>
					<div class="input-group">
						<span class="input-group-addon">*비밀번호 확인</span>
						<input type="password" id="password_confirm" name="password_confirm"class="form-control" placeholder="Password confirm">
					</div>
					<div class="input-group">
						<span class="input-group-addon">*이름</span>
						<input type="text" id="userName" name="name" class="form-control" placeholder="이름" value=<%= user.getName() %>>
					</div>
					<div class="input-group">
						<span class="input-group-addon">*E-mail</span>
						<input type="text" id="email" name="email" class="form-control" placeholder="E-mail" value=<%= user.getEmail()%>>
					</div>
					<div class="input-group" style=" width: 150px; float: left; ">
					<span class="input-group-addon">휴대폰번호</span>
					<div class="input-group-btn">
			        	<button type="button" class="btn btn-default dropdown-toggle" id="fstPNum" data-toggle="dropdown">010<span class="caret"></span></button>
				        <ul class="dropdown-menu">
				          <li onclick="changeNum(this)">010</li>
				          <li onclick="changeNum(this)">011</li>
				          <li onclick="changeNum(this)">017</li>
				          <li onclick="changeNum(this)">018</li>
				        </ul>
				    </div><!-- /btn-group -->
   				</div>
				<div class="input-group" style=" float: left; width: 150px; ">
					<span class="input-group-addon">-</span>
					<input type="text" id="midNum" class="form-control" onkeyup="phoneNum(this)">
				</div>
				<div class="input-group" style=" width: 150px; ">
					<span class="input-group-addon">-</span>
					<input type="text" id="lastNum" class="form-control" onkeyup="phoneNum(this)">
					<input type="hidden" id="pNum" name="pNum" class="form-control" placeholder="" value="010">
				</div>
					<div class="input-group">
						<span class="input-group-addon">학교</span>
						<input type="text" id="univ" name="univ" class="form-control" placeholder="학교" value=<%= user.getUniv() %>>
					</div>
					<div class="input-group">
						<span class="input-group-addon">학점</span>
						<input type="text" id="grade" name="grade" class="form-control" placeholder="학점" value=<%= user.getGrade() %>>
					</div>
					<div class="input-group">
					<div class="input-group-btn">
						<button type="button" id="lang1" name="lang1" class="btn btn-default dropdown-toggle" data-toggle="dropdown">어학성적<span class="caret"></span></button>
							<ul class="dropdown-menu">
								<% for(Language lang : langList) {%>
									<li><a href="#" onclick="selectLang(this, '<%=lang.getLangid()%>', lang1, langid1)"><%= lang.getLangName() %></a>
								<%} %>
							</ul>
					</div><!-- /btn-group -->
					<input type="hidden" name="langid1" id="langid1">
					<input type="text" name="langGrade1" class="form-control" placeholder="어학성적">
				</div>
				<div class="input-group">
					<div class="input-group-btn">
						<button type="button" id="lang2" name="lang2" class="btn btn-default dropdown-toggle" data-toggle="dropdown">어학성적<span class="caret"></span></button>
							<ul class="dropdown-menu">
								<% for(Language lang : langList) {%>
									<li><a href="#" onclick="selectLang(this, '<%=lang.getLangid()%>', lang2, langid2)"><%= lang.getLangName() %></a>
								<%} %>
							</ul>
					</div><!-- /btn-group -->
					<input type="hidden" name="langid2" id="langid2">
					<input type="text" name="langGrade2" class="form-control" placeholder="어학성적">
				</div>
				<div class="input-group">
					<div class="input-group-btn">
						<button type="button" id="lang3" name="lang3" class="btn btn-default dropdown-toggle" data-toggle="dropdown">어학성적<span class="caret"></span></button>
							<ul class="dropdown-menu">
								<% for(Language lang : langList) {%>
									<li><a href="#" onclick="selectLang(this, '<%=lang.getLangid()%>', lang3, langid3)"><%= lang.getLangName() %></a>
								<%} %>
							</ul>
					</div><!-- /btn-group -->
					<input type="hidden" name="langid3" id="langid3">
					<input type="text" name="langGrade3" class="form-control" placeholder="어학성적">
				</div>
					<p class="text-center">
						<button type="button" class="btn btn-default btn-lg" onclick="checkModifyInfo()">수정하기</button><br>
					</p>
					<p id="message" class="text-center text-warning">
					</p>
				</div>
			</div>
		</form>
	</div>
</body>
</html>